<%
  require 'fastercsv'
  
  fcsv_options = {
    :row_sep => "\n",
    :col_sep => active_scaffold_config.export_tool.delimiter,
    :force_quotes => active_scaffold_config.export_tool.force_quotes
  }
  data = FasterCSV.generate(fcsv_options) do |csv|
    csv << active_scaffold_tools_list_columns.collect { |column| column.label } unless active_scaffold_config.export_tool.skip_header
    @records.each do |record|
      csv << active_scaffold_tools_list_columns.collect { |column|
        column.inplace_edit = false
        #TODO 2007-09-01 (EJM) Level=0 - This needs to be resolved inside active_scaffold_column_checkbox somehow
        column.list_ui = :boolean if column.list_ui and column.list_ui.to_sym == :checkbox
        get_column_value(record, column).gsub("&nbsp;", "")
      }
    end
  end
-%><%= data -%>
